home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / board / GNUChess4_0_58.lha / gnuchess-4.0 / src / makefile next >
Makefile  |  1992-08-22  |  13KB  |  324 lines

  1. #
  2. # Makefile for GNU Chess
  3. #
  4. # Copyright (c) 1992 Free Software Foundation
  5. #
  6. # This file is part of GNU CHESS.
  7. #
  8. # GNU Chess is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2, or (at your option)
  11. # any later version.
  12. #
  13. # GNU Chess is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with GNU Chess; see the file COPYING.  If not, write to
  20. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21. #
  22.  
  23. #
  24. # gnuchess  is a curses-based chess.
  25. # gnuchessn is a fancy-display-curses-based chess.
  26. # gnuchessr is a plain dumb-terminal chess (but with full variation output)
  27. # gnuchessc is suitable for chesstool use (mimics /usr/games/chess output)
  28. # gnuchessx is the xchess based chess.
  29. #
  30.  
  31. # The version number of this GNU and Xboard release
  32. VERS=    4.0
  33. XVERS = 2.0
  34.  
  35. # Relevant file areas.
  36. DIST=    ../README ../README.lang ../doc ../misc ../src ../test
  37.  
  38. # Distribution directory
  39. DISTDIR=gnlib:
  40.  
  41. # Programs being distributed
  42. #PROGS=gnuchess-$(VERS) xboard-$(XVERS)
  43. PROGS=gnuchess-$(VERS)
  44.  
  45. # Change these to something less transitory, like /usr/games, and then
  46. # compile. Ask your system admin / unix guru to put gnuchess.{hash,lang,book}
  47. # in $(LIBDIR).
  48. # Where the binaries live.
  49. BINDIR= gnlib:
  50.  
  51. # Where language description, our book, and the persistent hash live.
  52. LIBDIR= gnlib:
  53.  
  54. # Display routines.
  55. #LCURSES=-lcurses -ltermcap
  56. LCURSES=-ltermcap
  57.  
  58. #compile options for gnuchess
  59. # -DAG[0-4]  selects a set of values for SpaceBonus tables
  60. # -DQUIETBACKGROUND don't print post information in background ( easy OFF)
  61. # -DNOMEMSET if your machine does not support memset
  62. # -DNOMATERIAL don't call it a draw when no pawns and both sides < rook
  63. # -DNODYNALPHA don't dynamically adjust alpha
  64. # -DHISTORY use history killer hueristic 
  65. # -DKILLT use killt killer hueristic 
  66. # -DNOSCORESPACE don't use Scorespace heuristic
  67. # -DOLDXBOARD don't generate underpromote moves
  68. # -DGNU3 don't generate underpromote moves
  69. # -DLONG64 if you have 64bit longs
  70. # -DSYSV   if you are using SYSV
  71. # some debug options
  72. # -DDEBUG8 dump board,movelist,input move to /tmp/DEBUG if illegal move
  73. # -DDEBUG9 dump move list from test command
  74. # -DDEBUG10 dump board and move after search before !easy begins
  75. # -DDEBUG11 dump board when the move is output
  76. # -DDEBUG12 dump boards between moves
  77. # -DDEBUG13 dump search control information for each move to /tmp/DEBUG
  78. # -DDEBUG40 include extra values of variables for debugging  in game list
  79. # the rest of the debug options are tied to the debuglevel command
  80. # -DDEBUG -DDEBUG4 set up code for debuglevel command
  81. #          debuglevel
  82. #               1 always force evaluation in evaluate
  83. #               4 print move list after search
  84. #               8 print move list after book before search
  85. #              16 print move list after each ply of search
  86. #              32 print adds to transposition table
  87. #              64 print returns from transposition table lookups
  88. #          256 print search tree as it is generated
  89.  
  90.  
  91. OPT= -DAG4 -DQUIETBACKGROUND -DNOSCORESPACE -DHISTORY
  92.  
  93. # The hashfile is a record of positions seen. It is used by
  94. # GNU Chess to avoid making the same mistakes, a form of learning.
  95. HASH=    -DHASHFILE=\"$(LIBDIR)gnuchess.hash\"
  96.  
  97. # The "book" is a record of the first few moves, for playing good
  98. # moves easily and quickly, saving time, and irritating the human
  99. # opponent.
  100. BOOK=    -DBOOK=\"$(LIBDIR)gnuchess.book\"
  101. #BINBOOK = -DBINBOOK=\"$(LIBDIR)/gnuchess.book.data\"
  102.  
  103. # The language file describes capabilities of the program. Perhaps
  104. # it is useful for non-English speaking countries and customizing
  105. # for their convenience and chess happiness.
  106. LANG= -DLANGFILE=\"$(LIBDIR)gnuchess.lang\"
  107.  
  108. # The compiler used for compiling this software.
  109. # Use this for a plain C compiler 
  110. #CC= cc $(OPT)
  111. # Use this for DEC's ANSI C compiler on Ultrix
  112. #CC= c89 $(OPT)
  113. # Use this if you are lucky enough to have GNU CC.
  114. CC=    gcc -W $(OPT)
  115. #CC=    /contrib/system/bin/gcc -W $(OPT)
  116.  
  117. # Miscellaneous CFLAGS. Uncomment the one you need and comment 
  118. # the other.
  119. #CFLAGS= -p -Dinline=""     -traditional-cpp
  120. #CFLAGS= -O4 -Qpath .  # SunOS cc using unprotoize
  121. #CFLAGS= -O4 # Sun acc
  122. #CFLAGS= -g  # debug
  123. CFLAGS= -O2
  124. #CFLAGS= +O3 -Aa -D_HPUX_SOURCE -DSYSV # HPUX cc 
  125. #CFLAGS= -O   -finline-functions -fstrength-reduce -D__mips -D__LANGUAGE_C # gnu cc 1.40 on DS5000
  126. #CFLAGS= -O   -finline-functions -fstrength-reduce  # gnu cc 1.40 on others
  127. #CFLAGS= -O2 -funroll-loops -D__mips -D__LANGUAGE_C # gnu cc 2.00 on DS5000
  128. #CFLAGS= -O2 -funroll-loops -traditional-cpp  # gnu cc  2.00 on SunOS
  129. #CFLAGS= -O2 -funroll-loops  # gnu cc  2.00 on others
  130.  
  131. all : gnuchess gnuchessr gnuchessn gnuchessx gnuchessc postprint gnuan game checkbook checkgame
  132.  
  133. gnuchess: mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o dspcomN.o uxdsp.o
  134.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchess mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o dspcomN.o uxdsp.o $(LCURSES)
  135.  
  136. gnuan: mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o gnuan.o
  137.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuan mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o gnuan.o
  138.  
  139. gnuchessc: mainC.o bookC.o genmovesC.o ataks.o util.o evalN.o init.o searchC.o dspcomC.o nondspC.o
  140.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchessc mainC.o bookC.o genmovesC.o ataks.o util.o evalN.o init.o searchC.o dspcomC.o nondspC.o
  141.  
  142. Dgnuchessr: mainDR.o bookN.o genmovesN.o ataks.o utilDR.o evalDR.o init.o searchDR.o dspcomDR.o nondspDR.o
  143.     $(CC)  -DDEBUG  -DDEBUG4 $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchessr mainDR.o bookN.o genmovesN.o ataks.o utilDR.o evalDR.o init.o searchDR.o dspcomDR.o nondspDR.o
  144.  
  145. gnuchessx: mainX.o bookX.o genmovesX.o ataks.o util.o evalN.o init.o searchX.o dspcomX.o nondspX.o
  146.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchessx mainX.o bookX.o genmovesX.o ataks.o util.o evalN.o init.o searchX.o dspcomX.o nondspX.o
  147.  
  148. gnuchessr: mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o dspcomR.o nondspR.o
  149.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchessr mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o dspcomR.o nondspR.o
  150.  
  151. gnuchessn: mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o dspcomN.o nuxdsp.o
  152.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchessn mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o dspcomN.o nuxdsp.o $(LCURSES)
  153.     
  154. game: game.c gnuchess.h
  155.     $(CC) $(CFLAGS) -o game game.c
  156.     
  157. postprint: postprint.o
  158.     $(CC) $(CFLAGS) -o postprint postprint.o
  159.     
  160. checkbook: checkbook.o
  161.     $(CC) $(CFLAGS) -o checkbook checkbook.o
  162.     
  163. checkgame: checkgame.o
  164.     $(CC) $(CFLAGS) -o checkgame checkgame.o
  165.  
  166. gnuan.o: gnuan.c gnuchess.h version.h
  167.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c gnuan.c
  168.  
  169. mainN.o: main.c gnuchess.h version.h
  170.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c main.c
  171.     mv main.o mainN.o
  172. mainC.o: main.c gnuchess.h version.h
  173.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  174.         -c main.c
  175.     mv main.o mainC.o
  176. mainX.o: main.c gnuchess.h version.h
  177.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DXBOARD  -c main.c
  178.     mv main.o mainX.o
  179. mainDR.o: main.c gnuchess.h version.h
  180.     $(CC)  -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANG) $(BOOK) \
  181.         -c main.c
  182.     mv main.o mainDR.o
  183.  
  184. genmovesN.o: genmoves.c gnuchess.h version.h
  185.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c genmoves.c
  186.     mv genmoves.o genmovesN.o
  187. genmovesC.o: genmoves.c gnuchess.h version.h
  188.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  189.         -c genmoves.c 
  190.     mv genmoves.o genmovesC.o
  191. genmovesX.o: genmoves.c gnuchess.h version.h
  192.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DXBOARD \
  193.         -c genmoves.c
  194.     mv genmoves.o  genmovesX.o
  195.  
  196. bookN.o: book.c gnuchess.h version.h
  197.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) $(BINBOOK) -c book.c 
  198.     mv book.o bookN.o
  199. bookC.o: book.c gnuchess.h version.h
  200.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  201.           $(BINBOOK) \
  202.         -c book.c 
  203.     mv book.o bookC.o
  204. bookX.o: book.c gnuchess.h version.h
  205.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DXBOARD  $(BINBOOK) \
  206.         -c book.c
  207.     mv book.o  bookX.o
  208.  
  209. ataks.o: ataks.h ataks.c gnuchess.h version.h
  210.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c ataks.c
  211.  
  212. util.o: util.c gnuchess.h version.h
  213.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c util.c
  214.  
  215. evalN.o: eval.c gnuchess.h version.h
  216.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c eval.c
  217.     mv eval.o evalN.o
  218. evalDR.o: eval.c gnuchess.h version.h
  219.     $(CC)  -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANG) $(BOOK) \
  220.         -c eval.c 
  221.     mv eval.o evalDR.o
  222. utilDR.o: util.c gnuchess.h version.h
  223.     $(CC)  -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANG) $(BOOK) \
  224.         -c util.c 
  225.     mv eval.o utilDR.o
  226.  
  227. init.o: init.c gnuchess.h version.h
  228.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c init.c
  229.  
  230. searchN.o: search.c gnuchess.h version.h
  231.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c search.c
  232.     mv search.o searchN.o
  233. searchC.o: search.c gnuchess.h version.h
  234.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  235.         -c search.c 
  236.     mv search.o searchC.o
  237. searchX.o: search.c gnuchess.h version.h
  238.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DXBOARD \
  239.         -c search.c 
  240.     mv search.o searchX.o
  241. searchDR.o: search.c gnuchess.h version.h
  242.     $(CC)  -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANG) $(BOOK) \
  243.         -c search.c 
  244.     mv search.o searchDR.o
  245.  
  246. uxdsp.o: uxdsp.c gnuchess.h version.h
  247.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c uxdsp.c
  248.  
  249. nuxdsp.o: nuxdsp.c gnuchess.h version.h
  250.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c nuxdsp.c
  251.  
  252. nondspC.o: nondsp.c gnuchess.h version.h
  253.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  254.         -c nondsp.c 
  255.     mv nondsp.o nondspC.o
  256. nondspX.o: nondsp.c gnuchess.h version.h
  257.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DXBOARD \
  258.         -c nondsp.c 
  259.     mv nondsp.o nondspX.o
  260. nondspR.o: nondsp.c gnuchess.h version.h
  261.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP \
  262.         -c nondsp.c 
  263.     mv nondsp.o nondspR.o
  264. nondspDR.o: nondsp.c gnuchess.h version.h
  265.     $(CC)  -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP \
  266.          -c nondsp.c 
  267.     mv nondsp.o nondspDR.o
  268.  
  269. dspcomN.o: dspcom.c gnuchess.h version.h
  270.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c dspcom.c
  271.     mv dspcom.o dspcomN.o
  272. dspcomC.o: dspcom.c gnuchess.h version.h
  273.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  274.         -c dspcom.c 
  275.     mv dspcom.o dspcomC.o
  276. dspcomX.o: dspcom.c gnuchess.h version.h
  277.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DXBOARD \
  278.         -c dspcom.c 
  279.     mv dspcom.o dspcomX.o
  280. dspcomR.o: dspcom.c gnuchess.h version.h
  281.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP \
  282.         -c dspcom.c 
  283.     mv dspcom.o dspcomR.o
  284. dspcomDR.o: dspcom.c gnuchess.h version.h
  285.     $(CC)  -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP \
  286.         -c dspcom.c 
  287.     mv dspcom.o dspcomDR.o
  288.  
  289. postprint.o: postprint.c gnuchess.h version.h
  290.     $(CC) $(CFLAGS) -c postprint.c
  291.  
  292. distribution:
  293.     -patchlevel=`cat $(DISTDIR)/gnuchess-$(VERS)/src/version.h|grep patchlevel|sed -e 's/[^0-9]//g'` ;\
  294.     echo "GNU patchlevel is $$patchlevel" ;\
  295.     xpatchlevel=`cat $(DISTDIR)/xboard-$(XVERS)/patchlevel.h|sed -e "s/#define PATCHLEVEL //"` ;\
  296.     cd $(DISTDIR) ;\
  297.     rm -f gnuchess.tar.$(VERS).Z* gnuchess.tar.$(VERS).Z.uu* ;\
  298.     tar cf - $(PROGS) | compress > $(DISTDIR)/gnuchess-$(VERS).pl$$patchlevel.tar.Z ;\
  299.     uuencode gnuchess-$(VERS).pl$$patchlevel.tar.Z gnuchess-$(VERS).pl$$patchlevel.tar.Z > gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  300.     rm -f x?? ;\
  301.     split -2500 gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  302.     for i in x??; do \
  303.       mv $$i $(DISTDIR)/GNU_Chess_$$i; \
  304.     done
  305.  
  306. install:
  307.     -cp gnuchessx $(BINDIR)/gnuchessx
  308.     -cp gnuchessc $(BINDIR)/gnuchessc
  309.     -cp gnuchessr $(BINDIR)/gnuchessr
  310.     -cp gnuchessn $(BINDIR)/gnuchessn
  311.     -cp postprint $(BINDIR)/postprint
  312.     -cp gnuan $(BINDIR)/gnuan
  313.     -cp gnuchess $(BINDIR)/gnuchess
  314.     -cp checkbook $(BINDIR)/checkbook
  315.     -cp checkgame $(BINDIR)/checkgame
  316.     -cp ../misc/gnuchess.book $(LIBDIR)/gnuchess.book
  317.     -cp ../misc/gnuchess.lang $(LIBDIR)/gnuchess.lang
  318.  
  319. clean:
  320.     -rm -f gnuchessx gnuchessc gnuchess gnuchessr gnuchessn gnuchessd postprint gnuan checkbook checkgame game
  321.     -echo $(DISTDIR)
  322.     -rm -f $(DISTDIR)/gnuchess-4.0/misc/gnuchess.book.data
  323.     -find $(DISTDIR) \( -name '*.o' -o -name '*~' -o -name 'CL*' -o -name 'PATCH*' -o -name '#*#' -o -name '%*%' -o -name '*orig' \) -exec rm -f {} \;
  324.